#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n = 0;
	int i = 0;
	int arr[50] = { 0 };
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		arr[i] = i;
	}
	int x = 0;
	scanf("%d", &x);
	for ( i = n - 1; i >= 0; i--)
	{
		if (arr[i] > x)
		{
			arr[i + 1] = arr[i];
		}
	}
	arr[i + 1] = x;
	for (i = 0; i < n + 1; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}